package com.cn.study0014.bank.com;

/**
 * @author lw
 * @ClassName Account.java
 * @Description
 * @createTime 2023年05月18日 16:43:00
 */
public class Account {
    double deposit;
    /**
     * 存款
     * @param dep
     */
    public void addDe(double dep){
        if (dep>0){
            this.deposit+=dep;
            System.out.println("存款成功！");
        }else {
            System.out.println("存款失败！");
        }
    }
    /**
     * 取款
     * @param dep
     */
    public void withdrawals(double dep){
        if (deposit-dep>0){
            this.deposit-=dep;
            System.out.println("取款成功！");
        }else {
            System.out.println("金额不足！");
        }
    }

    public void showde(){
        System.out.println("\n***当前余额："+deposit+"元*****\n");
    }

}
